home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nejlepší hry
/
Nejlepsi hry.iso
/
hry
/
sea of chaos
/
sea_install.msi
/
_15C39AAA7726369D39812BD40F01CF6A
/
_C93B0C314A464CF58B998A621D5D39EF
< prev
next >
Wrap
Text File
|
2005-07-30
|
974b
|
58 lines
//show parts starting from left to right
//Luke Lenhart
//(C)2004-2005 Digipen Institute of Technology
//texture sampler
sampler2D sampTex;
//max x position to show
float maxX;
float maxZ;
//shader input
struct PS_INPUT
{
float4 Color : COLOR;
float2 Tex0 : TEXCOORD0;
float4 Pos : TEXCOORD1;
};
//shader code
float4 PShader(PS_INPUT In) : COLOR
{
/*
clip(In.Pos.x-maxX);
//mod vert color with texture color
float4 clr;
float4 texclr=tex2D(sampTex,In.Tex0);
//clr.xyz=texclr.xyz*In.Color.xyz;
clr.xyz=1-(1-texclr.xyz)*In.Color.xyz;
//alpha based on x
clr.a=saturate((In.Pos.x-maxX)*1.5f)*texclr.a;
//spit out color
return clr;
*/
//??? ... !
float4 clr;
float4 texclr=tex2D(sampTex,In.Tex0);
if(texclr.g<0.715f)
{
clr.xyz = lerp(In.Color.xyz,1,(maxZ-In.Pos.z)/maxZ);
}
else
clr.xyz = texclr.xyz;
clr.a=(In.Pos.x-maxX)*texclr.a;
//spit out color
return clr;
}